﻿<!-- Begin add new code by D-Ngan 13 Aug 2012
	@Author: Nguyen Duc Ngan
    @Description: This is home template for 99xu.vn. It show the product category 
    Date : 13 Aug 2012
-->

<!--Create a inside css code-->
<style type="text/css">
.rows{
	width:755px;
}
.rows .title {
	height: 20px;
	color:#2A1FFF;
	font-size:12px;
	font-weight:bold;
	border-color:black;
	background: #F0F3F7;
	border:1px solid #D8DFEA;
	padding:5px 0px 5px 0px;
	margin: 5px 0; 
	text-transform:uppercase;
	}

.rows .title label {
	color:#2A00AA;
	font-size:1.2em;
	font-weight:bold;
	text-transform:uppercase;
}
.product_title{
	margin: 5px 0px 5px 0px;
	clear:both;
	color:#339999;
	font-size:12px;
	font-weight:bold;
	text-transform:uppercase;
	height:30px;
}
.product_image{
	clear:both;
	height:170px;
	
}
.product_info{
	clear:both;
	height:100px;
	margin: 0px 10px 0px 10px;
}
.product_price{
	font-size:12px;
	font-weight:bold;
	text-align:center;
	clear:both;
}
.product_address{
	color:#a5a5a5;
	font-size:14px;
	text-align:center;
	font-weight:bold;
	clear:both;
}
.product_get{
	clear:both;
	color:#C22227;
	font-weight:bold;
	text-align:right;
}
</style><!--End css code-->
<?php
//Repare date
/*
//Attribute of product
	product_id
	customer_id 
	username    
	address 	 
	name    
	model
	rating  	 
	stars   	 
	thumb:image(210x210)   	 
	price   
	special 	 
	href_shop: link shop	   
	href_more: link to product list
	href     :link to dettal 
	
//Attribute of category
	category_id
	name        
	image                 
	parent_id                      
	date_added           
	date_modified    
	language_id                           
	meta_description         
	description 	 
*/
$category =array();
$products =array();
if(isset($product_data)){
	foreach ($product_data as $pro){
		$category[]=$pro;
		$products[]=$pro['Product'];
	}
}
?>
<div class="one_tab" style="background: #5d94d7;">
    <?php echo $heading_title; ?>
</div>
<div class="content_home">
   <?php
	for($category_index=0;$category_index<=7;$category_index++)
	{
	?>
    <div class="rows">
	<!-- Edit by Q Hieu 09/11/2012-->
		<?php 
			switch($category_index){
				case 0: $href = "index.php?route=product/category&path=64_85"; break;
				case 1:	$href = "index.php?route=product/category&path=64_122"; break;
				case 2:	$href = "index.php?route=product/category&path=64_123"; break;
				case 3:	$href = "index.php?route=product/category&path=64_124"; break;
				case 4:	$href = "index.php?route=product/category&path=64_125"; break;
				case 5:	$href = "index.php?route=product/category&path=64_126"; break;
				case 6:	$href = "index.php?route=product/category&path=64_127"; break;
				case 7:	$href = "index.php?route=product/category&path=64_128"; break;
				default: break;
			}
		?>	
	<!--End edit by Q Hieu 09/11/2012-->
    	<div id="top_header"><a href = <?php echo $href?>> <?php echo $category[$category_index]['name'];?></a>
        </div>
        <div class="entry">
          <table width="750px">
          <tr>
          <?php for ($i=0;$i<4;$i++){?>
            <td width="180px" style="border: 1px solid #d9e7ff;">
                <div class="product_title">
                	<?php if(isset($products[$category_index][$i]['name'])) echo $products[$category_index][$i]['name'];?>
                </div>
                <div class="product_image">
                	<?php
						echo '<a href="';
						if(isset($products[$category_index][$i]['href'])) echo $products[$category_index][$i]['href'];
						echo '"><img class="lazy" width="160px" height="160px" data-original="';
						if(isset($products[$category_index][$i]['thumb'])) echo $products[$category_index][$i]['thumb']; 
							else{echo 'image/logo/logo_new.gif';}
						echo '"></a>';
					?>
                </div>
                <div class="product_info">
                	<div class="product_price">
                	<?php if(isset($products[$category_index][$i]['price'])) echo $products[$category_index][$i]['price']; ?>
                    </div>
                    <div class="product_address">
					<?php if(isset($products[$category_index][$i]['address'])) echo $products[$category_index][$i]['address']; ?>
                    </div>
                    <div class="product_get">
						<?php 
							echo '<a href="';
							if(isset($products[$category_index][$i]['href'])) echo $products[$category_index][$i]['href'];
							echo '">';
							echo 'Chi tiết';
							echo '</a>';
						 ?>
                    </div>
                </div>
            </td>
          <?php }?>
          </tr>
          </table>
        </div>
    </div>
   
    <?php 
	}
    ?>
 <!-- Lazyload Le Quoc Nam 18/10/2012 -->   
 <script type="text/javascript" src="catalog/view/javascript/lazyload/jquery.lazyload.js" charset="utf-8"></script>
 <script type="text/javascript" charset="utf-8">
      $(function() {
          $("img.lazy").lazyload({
              effect : "fadeIn",
          });
      });
  </script>

